<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("basePath", basePath);
	request.setAttribute("path", path);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basePath }style/default.css">
</head>
<script type="text/javascript">
	var temp = false;
	function init() {
		initBomDate();
	}
	//标记已读
	function save() {
		var v = getGridSelectValues(1);
		if (v.length > 0) {
			SN.alert.confirm("是否要标记" + v.length + "数据为已读！", function(obj) {
				if (obj) {
					$.ajax({
						type : 'POST',
						url : 'page/system/manage/Index/doUpd',
						data : {
							"map.guid" : v,
						},
						dataType : "json",
						async : true,
						cache : false,
						jsonpCallback : "null",
						success : function(response, status, statusText) {
							//alert(response + ":" + status + ":" + statusText);
							if (response.status) {
								SN.alert.info(response.content, function() {
									query();
									closeWindow();
								});

							} else {
								alert(response.content);
							}
						},
						error : function(response, status, statusText) {
							//alert(response + ":" + status + ":" + statusText);
						},
						complete : function(response, status, statusText) {
							//alert(response + ":" + status + ":" + statusText);
						}
					});
				}
			});
		} else {
			SN.alert.error("请选择一条记录");
		}

	};
</script>
<script type="text/javascript">
	function query() {
		parent.initMessageNum();
	}
	function closeWindow() {

		parent.w1.close();
	}
</script>
<script type="text/javascript">
	function initBomDate() {
		var v = getValue();
		$.ajax({
			type : 'POST',
			url : '${basePath}page/system/manage/Index/queryMessage',
			data : v,
			dataType : "json",
			async : true,
			cache : false,
			jsonpCallback : "null",
			success : function(response, status, statusText) {
				console.debug(response);
				if (response.status) {
					var a = response.content.currentPageNum;
					var b = response.content.allPageNum;
					var c = response.content.allCount;
					setValue(a, b, c);
				} else {
					alert();
				}
			},
			error : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
			},
			complete : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
			}
		});
	}
</script>
<script type="text/javascript">
	//回到顶部按钮添加
	$(document).ready(function() {
		GP.goup({
			trigger : 100,
			bottomOffset : 30,
			locationOffset : 30,
			titleAsText : true,
			containerColor : '#7e7f7e'
		}, "Panel_");
	});
</script>
<style>
.form-group>.col-xs-2 {
	width: 16%;
}

.tableCont {
	margin-top: 5px;
	margin-bottom: 5px;
}
</style>
<body onload="init()">
	<form class="form-horizontal MyForm" id="MyForm" name="MyForm"
		method="post" target="MyFrame" enctype="multipart/form-data">
		<table class="contTable">
			<tr class="firstTr">
				<td>
					<button onclick="save()" class="btn btn-primary" type="button"
						id="sign">
						<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>&nbsp;<span>标记</span>
					</button>
					<button onclick="closeWindow()" class="btn btn-primary"
						type="button">
						<span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span>&nbsp;<span>关闭</span>
					</button>
				</td>
			</tr>
			<tr style="height:auto">
				<td valign="top">
					<div id="Panel_" style="width:100%;overflow-y:auto;height:400px;">
						<div style="width: 100%;height: 100%;">
							<table class="listTableClass" border="0" cellpadding="0"
								cellspacing="0">
								<tr class="listTrClass" style="width:100%;">
									<td colspan='7' class="listTdClass">
										<table class="listTableClass" border="0" cellpadding="0"
											cellspacing="0">
											<tr class="listTrClass">
												<td>
													<div
														style="height: 100%;overflow: auto;border:1px solid #e3e3e3 ">
														<jsp:include page="/common/grid_toolbar.jsp">
															<jsp:param value="query" name="func" />
															<jsp:param value="setValue" name="setValue" />
															<jsp:param value="getValue" name="getValue" />
															<jsp:param value="getGrid" name="getGrid" />
															<jsp:param value="getGridSelectValues"
																name="getGridSelectValues" />
															<jsp:param value="true" name="isPaging" />
															<jsp:param value="true" name="isCheck" />
														</jsp:include>
													</div>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
